{{define "mobile/ordinary/laboratoryE.html"}}
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
        <meta name="format-detection" content="telephone=no">
        <title>实验室检查</title>
        <link rel="stylesheet" type="text/css" href="/res/mobile/css/weui.css"/>
        <link rel="stylesheet" type="text/css" href="/res/mobile/css/example.css"/>
        <link rel="stylesheet" type="text/css" href="/res/mobile/css/bootstrap.min.css"/>
        <link rel="stylesheet" type="text/css" href="/res/mobile/css/base.css?v=2"/>
        <style>
            .yichang {
                color: #ff0000;
                font-weight: bold;
            }
        </style>
    </head>
    <body ontouchstart>
    <div class="header">实验室检查</div>
    <div class="container" id="container">
        <div class="page flex js_show">
            <div class="page__bd" style="height: 100%;">
                <div class="weui-tab">
                    <div class="weui-tab__panel">
                        <div class="page__bd page__bd_spacing">
                            <div class="_cut"></div>
                            <div class="personal second-title">血糖</div>
                            <div class="weui-flex">
                                <div class="weui-flex__item">
                                    <div class=" weui-ws_three">检查时间：<span class=" "
                                                                           id="shiyanshi_xuetang_kongfu_checkDate"></span>
                                    </div>
                                    <div class=" weui-ws_three ">空腹血糖(mmol/L)：<span class=" "
                                                                                    id="xuetang_kongfu"></span></div>
                                    <div class=" weui-ws_three ">参考值(mmol/L)：<span>3.9～6.1</span></div>
                                </div>
                            </div>
                            <div class="weui-flex">
                                <div class="weui-flex__item">
                                    <div class=" weui-ws_three">检查时间：<span class=" "
                                                                           id="shiyanshi_xuetang_canhou_checkDate"></span>
                                    </div>
                                    <div class=" weui-ws_three ">餐后两小时血糖(推荐)(mmol/L)：<span class=" "
                                                                                           id="xuetang_canhou"></span>
                                    </div>
                                    <div class=" weui-ws_three ">参考值(mmol/L)：<span>3.9～7.8</span></div>
                                </div>
                            </div>
                            <div class="weui-flex">
                                <div class="weui-flex__item">
                                    <div class=" weui-ws_three">检查时间：<span class=" "
                                                                           id="shiyanshi_xuetang_thxhdb_checkDate"></span>
                                    </div>
                                    <div class=" weui-ws_three ">糖化血红蛋白(%)：<span class=" " id="xuetang_thxhdb"></span>
                                    </div>
                                    <div class=" weui-ws_three ">参考值：<span>4%～6%</span></div>
                                </div>
                            </div>
                            <div class="_cut"></div>
                            <div class="personal second-title">血脂</div>
                            <div class="weui-flex">
                                <div>
                                    <div class="placeholder">检查时间：</div>
                                </div>
                                <div class="weui-flex__item">
                                    <div class="placeholder" id="bloodFatExamineDate"></div>
                                </div>
                            </div>
                            <div class="weui-flex">
                                <div class="weui-flex__item">
                                    <div class=" weui-ws_three ">甘油三脂(mmol/L)：<span class=" "
                                                                                    id="xuezhi_ganyousanzhi"></span>
                                    </div>
                                    <div class=" weui-ws_three ">参考值(mmol/L)：<span>0.56～1.70</span></div>
                                </div>

                            </div>
                            <div class="weui-flex">
                                <div class="weui-flex__item">
                                    <div class=" weui-ws_three ">胆固醇(mmol/L)：<span class=" "
                                                                                    id="xuezhi_danguchun"></span>
                                    </div>
                                    <div class=" weui-ws_three ">参考值(mmol/L)：<span> < 5.2</span></div>
                                </div>
                            </div>
                            <div class="weui-flex">
                                <div class="weui-flex__item">
                                    <div class=" weui-ws_three ">低密度脂蛋白胆固醇(mmol/L)：<span class=" "
                                                                                   id="xuezhi_dimidu"></span>
                                    </div>
                                    <div class=" weui-ws_three ">参考值(mmol/L)：<span> ≤ 3.12</span></div>
                                </div>
                            </div>
                            <div class="weui-flex">
                                <div class="weui-flex__item">
                                    <div class=" weui-ws_three ">高密度脂蛋白胆固醇(mmol/L)：<span class=" "
                                                                                         id="xuezhi_gaomidu"></span>
                                    </div>
                                    <div class=" weui-ws_three ">参考值(mmol/L)：<span> 1.03～2.07</span></div>
                                </div>
                            </div>
                            <div class="_cut"></div>
                            <div class="personal second-title">同型半胱氨酸</div>
                            <div class="weui-flex">
                                <div class="">
                                    <div class="placeholder">检查时间：</div>
                                </div>
                                <div class="weui-flex__item">
                                    <div class="placeholder " id="shiyanshi_hcyExamineDate"></div>
                                </div>
                            </div>
                            <div class="weui-flex">
                                <div class="weui-flex__item">
                                    <div class=" weui-ws_three ">同型半胱氨酸(μmol/L)：<span class=" "
                                                                                         id="shiyanshi_hcy"></span>
                                    </div>
                                    <div class=" weui-ws_three ">参考值(μmol/L)：<span> 5~15</span></div>
                                </div>
                            </div>
                        </div>
                        <div class="button-sp-area cell">
                            <a onclick="history.back(-1);return false;"
                               class="weui-btn_cell weui-btn_cell-default">返回</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="/res/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" src="/res/mobile/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript" src="/res/mobile/js/weui.min.js"></script>
    <!-- <script type="text/javascript" src="/res/mobile/js/example.js"></script> -->
    <script type="text/javascript" src="/res/mobile/js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" class="tabbar js_show">
        $(function () {
            //获取用户信息
            $.post("/mobile/ordinary/getUserData", {}, function (r) {
                if (r) {
                    if (r.code != 1) {
                        window.location.href = "/mobile/ordinary/login"
                    } else {
                        var labExamination = r.data["labExamination"];
                        if (labExamination) {
                            let min;
                            let max;
                            $.each(labExamination, function (i, v) {
                                //$("#"+i).append(displayVal(v,));
                                min = 0;
                                max = 0;
                                switch (i) {
                                    case "xuetang_kongfu":
                                        min = 3.9;
                                        max = 6.1;
                                        break;
                                    case "xuetang_canhou":
                                        min = 3.9;
                                        max = 7.8;
                                        break;
                                    case "xuetang_thxhdb":
                                        min = 4;
                                        max = 6;
                                        break;
                                    case "xuezhi_ganyousanzhi":
                                        min = 0.56;
                                        max = 1.7;
                                        break;
                                    case "xuezhi_danguchun":
                                        min = 0;
                                        max = 5.2;
                                        break;
                                    case "xuezhi_dimidu":
                                        min = 0;
                                        max = 3.12;
                                        break;
                                    case "xuezhi_gaomidu":
                                        min = 1.03;
                                        max = 2.07;
                                        break;
                                    case "shiyanshi_hcy":
                                        min = 5;
                                        max = 15;
                                        break;
                                }
                                if (max != 0) {
                                    $("#" + i).append(displayVal(v, min, max));
                                } else {
                                    $("#" + i).text(v);
                                }
                            })
                        }
                    }
                } else {
                    window.location.href = "/mobile/ordinary/login"
                }
            })
        });


        function displayVal(val, min, max) {
            let html = $("<span>" + val + "</span>");
            let shang = $("<span style='size: 18px;'>&nbsp;↑</span>");
            let xia = $("<span style='size: 18px;'>&nbsp;↓</span>");
            let v;
            if (val != "") {
                v = parseFloat(val);
                if (v < min || v > max) {
                    html.addClass('yichang');
                    if (v < min) {
                        html.append(xia);
                    } else if (v > max) {
                        html.append(shang);
                    }
                }
            }
            return html;
        }
    </script>
    </body>
    </html>
{{end}}